home *** CD-ROM | disk | FTP | other *** search
/ Codemasters Artwork Disc ECTS 2000 ( UK) / Codemasters - Artwork Disc ECTS 2000 (UK).bin / pc / xtras / medial~1 / setfx~1.dir / Internal_22_Utility Scripts.ls < prev    next >
Encoding:
Text File  |  1998-12-01  |  5.0 KB  |  207 lines

  1. on ButtonHandler sNum
  2.   if not sNum then
  3.     set sNum to the clickOn
  4.   end if
  5.   if sNum < 1 then
  6.     return 0
  7.   end if
  8.   set mNum to the memberNum of sprite sNum
  9.   if mNum < 0 then
  10.     exit
  11.   end if
  12.   set mname to the name of member mNum
  13.   if not stringp(mname) then
  14.     exit
  15.   end if
  16.   set the member of sprite sNum to member (mname && "down")
  17.   set click to 1
  18.   updateStage()
  19.   repeat while the mouseDown
  20.     if rollOver(sNum) then
  21.       set the member of sprite sNum to member (mname && "down")
  22.       set click to 1
  23.     else
  24.       set the member of sprite sNum to member mname
  25.       set click to 0
  26.     end if
  27.     updateStage()
  28.   end repeat
  29.   if click then
  30.     set the member of sprite sNum to member mname
  31.     updateStage()
  32.     return 1
  33.   else
  34.     return 0
  35.   end if
  36. end
  37.  
  38. on holdPuppets a, b
  39.   repeat with i = a to b
  40.     puppetSprite(i, 1)
  41.   end repeat
  42. end
  43.  
  44. on releasePuppets a, b
  45.   repeat with i = a to b
  46.     puppetSprite(i, 0)
  47.   end repeat
  48. end
  49.  
  50. on resetDisplay
  51.   global fxDisplayMember
  52.   preLoad(member fxDisplayMember)
  53.   RemoveAllEffects(member fxDisplayMember)
  54. end
  55.  
  56. on ExpandWindow
  57.   global fxWindow, fxHelp
  58.   set r to the rect of fxWindow
  59.   set the bottom of r to the top of r + 300
  60.   set the rect of fxWindow to r
  61.   set the picture of member "helpButton" to the picture of member "helpButton on"
  62.   set fxHelp to 1
  63. end
  64.  
  65. on CollapseWindow
  66.   global fxWindow, fxHelp
  67.   set r to the rect of fxWindow
  68.   set the right of r to the left of r + 528
  69.   set the bottom of r to the top of r + 230
  70.   set the rect of fxWindow to r
  71.   set the picture of member "helpButton" to the picture of member "helpButton off"
  72.   set fxHelp to 0
  73. end
  74.  
  75. on OK
  76.   global fxTrackingObj
  77.   setMemberEffects(fxTrackingObj)
  78.   cancel(0)
  79. end
  80.  
  81. on Settings
  82.   if objectp(fxCurObj) then
  83.     Release(fxCurObj)
  84.   end if
  85.   go("General Member Settings")
  86. end
  87.  
  88. on About
  89.   if objectp(fxCurObj) then
  90.     Release(fxCurObj)
  91.   end if
  92.   go("About")
  93. end
  94.  
  95. on cancel cleanUp
  96.   global fxTrackingObj, fxCurObj
  97.   if objectp(fxCurObj) then
  98.     Release(fxCurObj)
  99.   end if
  100.   if objectp(fxTrackingObj) then
  101.     clearTests(fxTrackingObj)
  102.   end if
  103.   if cleanUp then
  104.     resetProperties(fxTrackingObj)
  105.   end if
  106.   set fxTrackingObj to 0
  107.   closeWindow()
  108.   tell the stage
  109.     updateStage()
  110.   end tell
  111. end
  112.  
  113. on VerifySpriteEffect sNum, fxsym
  114.   if the type of member the castNum of sprite sNum = #alpha then
  115.     set fxl to GetEffectList(sprite(sNum))
  116.     set pos to getPos(fxl, fxsym)
  117.     return pos
  118.   end if
  119.   return 0
  120. end
  121.  
  122. on enableInterfaceElement i, enabled
  123.   puppetSprite(i, 1)
  124.   if the memberNum of sprite i < 1 then
  125.     exit
  126.   end if
  127.   set memName to the name of the member of sprite i
  128.   if memName = EMPTY then
  129.     set memName to the member of sprite i
  130.   end if
  131.   if enabled then
  132.     if the type of the member of sprite i = #bitmap then
  133.       if the depth of member memName = 1 then
  134.         set the foreColor of sprite i to 255
  135.       else
  136.         if memName contains "Dim" then
  137.           set memName to word 1 to the number of words in memName - 1 of memName
  138.         end if
  139.       end if
  140.       set the member of sprite i to member memName
  141.     else
  142.       if the type of the member of sprite i = #shape then
  143.         if the shapeType of the member of sprite i = #line then
  144.           set the foreColor of sprite i to 255
  145.         end if
  146.       else
  147.         if the type of the member of sprite i = #field then
  148.           if field memName = EMPTY then
  149.             put "--" into field memName
  150.           end if
  151.           set the foreColor of field memName to textColor(#black)
  152.           if the ink of sprite i = 0 then
  153.             set the editableText of sprite i to 1
  154.           end if
  155.         end if
  156.       end if
  157.     end if
  158.   else
  159.     if the type of the member of sprite i = #bitmap then
  160.       if the depth of member memName = 1 then
  161.         set the foreColor of sprite i to 249
  162.       else
  163.         if memName contains "Dim" then
  164.           nothing()
  165.         else
  166.           if memName contains "Down" then
  167.             set memName to word 1 to the number of words in memName - 1 of memName
  168.             put " Dim" after memName
  169.           else
  170.             put " Dim" after memName
  171.           end if
  172.         end if
  173.       end if
  174.       if the number of member memName > 0 then
  175.         set the member of sprite i to member memName
  176.       end if
  177.     else
  178.       if the type of the member of sprite i = #shape then
  179.         if the shapeType of the member of sprite i = #line then
  180.           set the foreColor of sprite i to 249
  181.         end if
  182.       else
  183.         if the type of the member of sprite i = #field then
  184.           if field memName = EMPTY then
  185.             put "--" into field memName
  186.           end if
  187.           set the foreColor of field memName to textColor(#gray)
  188.           if the ink of sprite i = 0 then
  189.             set the editableText of sprite i to 0
  190.           end if
  191.         end if
  192.       end if
  193.     end if
  194.   end if
  195.   updateStage()
  196. end
  197.  
  198. on textColor c
  199.   if c = #black then
  200.     return the foreColor of word 1 of field "textcolors"
  201.   else
  202.     if c = #gray then
  203.       return the foreColor of word 2 of field "textcolors"
  204.     end if
  205.   end if
  206. end
  207.